/* 全局样式 */
.stApp {
    background-color: #f0f2f6;
}

/* 主容器样式 */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #f0f2f6;
}

/* 聊天区域 */
.chat-container {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: calc(100vh - 200px);
}

/* 消息样式 */
.stChatMessage {
    background: transparent !important;
    padding: 0.5rem 0;
}

/* 用户消息 */
[data-testid="stChatMessageContent"]:has([data-testid="chatAvatarIcon-user"]) {
    background-color: #e3f2fd !important;
    margin-left: auto !important;
    margin-right: 1rem !important;
    border-radius: 15px 15px 0 15px !important;
    padding: 0.8rem !important;
    max-width: 80% !important;
}

/* 助手消息 */
[data-testid="stChatMessageContent"]:has([data-testid="chatAvatarIcon-assistant"]) {
    background-color: #ffffff !important;
    margin-right: auto !important;
    margin-left: 1rem !important;
    border-radius: 15px 15px 15px 0 !important;
    padding: 0.8rem !important;
    max-width: 80% !important;
    border: 1px solid #e0e0e0;
}

/* 头像样式 */
[data-testid="chatAvatarIcon-user"] {
    background-color: #1976d2 !important;
    padding: 5px;
}

[data-testid="chatAvatarIcon-assistant"] {
    background-color: #4caf50 !important;
    padding: 5px;
}

/* 输入框样式 */
.stChatInput {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    background-color: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    padding: 10px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stChatInput input {
    border: none !important;
    padding: 8px !important;
    background-color: white !important;
    color: #2c3e50 !important;
}

.stChatInput input:focus {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* 侧边栏样式 */
[data-testid="stSidebar"] {
    background-color: #2c3e50 !important;
    padding: 2rem 1rem;
}

[data-testid="stSidebar"] h3 {
    color: #ffffff !important;
    font-size: 1rem;
    margin-top: 1.5rem;
}

/* 按钮样式 */
.stButton > button {
    background-color: #3498db !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 5px !important;
    transition: all 0.3s ease;
    width: 100%;
}

.stButton > button:hover {
    background-color: #2980b9 !important;
    transform: translateY(-1px);
}

/* 标题样式 */
h1 {
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* 提示信息样式 */
.stAlert {
    padding: 0.8rem;
    border-radius: 5px;
    margin: 0.5rem 0;
}

/* 下拉框样式 */
.stSelectbox {
    background-color: #34495e !important;
    color: white !important;
    border-radius: 5px !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 消息内容样式 */
.message-content {
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 0.5rem;
}

/* 代码块样式 */
.stCodeBlock {
    margin: 0.5rem 0;
    border-radius: 5px;
}

/* 列表样式 */
.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* 时间戳样式 */
.message-time {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 0.2rem;
}

/* 长文本自动换行 */
[data-testid="stChatMessageContent"] {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* 聊天容器 */
.gradio-container {
    max-width: 1200px !important;
}

/* 聊天气泡 */
.message {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 15px;
    max-width: 80%;
}

.user-message {
    background-color: #e3f2fd;
    margin-left: auto;
    border-radius: 15px 15px 0 15px;
}

.bot-message {
    background-color: #f5f5f5;
    margin-right: auto;
    border-radius: 15px 15px 15px 0;
}

/* 输入框 */
.input-area {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem;
    border-top: 1px solid #eee;
}

/* 按钮样式 */
.button-primary {
    background: #2196f3 !important;
    color: white !important;
}

.button-secondary {
    background: #9e9e9e !important;
    color: white !important;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease-out;
} 